package com.sc.nft.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.MallActivityShareTeam;
import com.sc.nft.entity.UserInfo;
import com.sc.nft.entity.dto.ActivityShareTeamPopUpDetailDTO;
import com.sc.nft.entity.dto.AdminMallActivityShareTeamPageDTO;
import com.sc.nft.entity.dto.MallActivityShareTeamDetailDTO;
import com.sc.nft.entity.dto.MallActivityShareTeamPageDTO;
import com.sc.nft.entity.vo.AdminMallActivityShareTeamPageVO;
import com.sc.nft.entity.vo.MallActivityShareTeamPageVO;
import com.sc.nft.enums.ShareTeamStatusEnum;

import java.util.List;

/**
 * <p>
 * 分享购团队信息 服务类
 * </p>
 *
 * @author ligen
 * @since 2023-12-13
 */
public interface MallActivityShareTeamService {

    /**
     * 后台分享成团列表
     *
     * @param adminMallActivityShareTeamPageVO
     * @return
     */
    Page<AdminMallActivityShareTeamPageDTO> getAdminMallActivityShareTeamPageDTO(AdminMallActivityShareTeamPageVO adminMallActivityShareTeamPageVO);

    /**
     * 用户端分享成团列表
     *
     * @param userInfo
     * @param mallActivityShareTeamPageVO
     * @return
     */
    Page<MallActivityShareTeamPageDTO> getMallActivityShareTeamPageDTO(UserInfo userInfo, MallActivityShareTeamPageVO mallActivityShareTeamPageVO);

    /**
     * 用户成团详情
     *
     * @param userInfo
     * @param teamId
     * @return
     */
    MallActivityShareTeamDetailDTO getMallActivityShareTeamDetailDTO(UserInfo userInfo, Long teamId);

    /**
     * 获取分享团队弹窗信息
     *
     * @param teamId
     * @return
     */
    ActivityShareTeamPopUpDetailDTO getActivityShareTeamPopUpDetailDTO(Long teamId);

    /**
     * 是否已开团
     *
     * @param userId
     * @param activityShareId
     * @return
     */
    MallActivityShareTeam hasShareTeamDetail(Long userId, Long activityShareId);

    /**
     * 用户开团
     *
     * @param userInfo
     * @param activityShareId
     * @return
     */
    MallActivityShareTeamDetailDTO userStartShareTeam(UserInfo userInfo, Long activityShareId);

    /**
     * 获取用户开团
     *
     * @param id
     * @return
     */
    MallActivityShareTeam getById(Long id);

    /**
     * 获取分享购的团队
     *
     * @param activityShareId
     * @return
     */
    List<MallActivityShareTeam> getListByActivityShareId(Long activityShareId, ShareTeamStatusEnum status);

    /**
     * 修改拼团状态
     *
     * @param id     成团ID
     * @param status 成团状态
     * @return
     */
    Boolean updateStatus(Long id, ShareTeamStatusEnum status);

    /**
     * 修改成团是是否可以发放收益
     *
     * @param id
     * @param isCanIssue
     * @return
     */
    Boolean updateIsCanIssue(Long id, Boolean isCanIssue, Boolean updateEndTime);

    /**
     * 添加成团订单数量
     *
     * @param id
     * @param count
     * @return
     */
    Boolean addOrderNumById(Long id, Integer count);

    /**
     * 减少有效订单数量
     *
     * @param id
     * @param count
     * @return
     */
    Boolean subValidOrderNumById(Long id, Integer count);

    /**
     * 获取上下架分享购的团队列表
     *
     * @return
     */
    List<MallActivityShareTeam> getListByShareStatus();

}
